import *as types from "../mutation-types"
const state={
  all:[],
  show:false,
  showData:{},
  collectData:[],
  MenuShow:{},
}

const getters={
  getAll:state=>state.all,
  getShow:state=>state.show,
  getShowData:state=>state.showData,
  getCollectData:state=>state.collectData,
  getMenuShow:state=>state.MenuShow
}

const mutations={
  [types.SHOW_LIST_MORE](state,{item}){
    state.show=true
    state.showData=item
    console.log(state.showData,"showData")
  },
  [types.ADD_TO_COLLECT](state,{item}){
    let lord=state.collectData.find(f=>f.id===item.id)
    if (!lord){
      state.collectData.push(item)
    }
    console.log(state.collectData)
  },
  [types.CHANGE_TYPE](state,{item}){
    state.MenuShow=item
    console.log(state.MenuShow)
  }
}

const actions= {

}

export default {
  state,
  getters,
  mutations,
  actions,
}
